package com.zrar.ak.gkpt.dao;

import com.zrar.ak.gkpt.model.bo.BusinessFundManageAdjustFundDetailsBO;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import tk.mybatis.mapper.common.Mapper;

/**
 * @ClassName: BusinessFundManageAdjustFundDetailsDao
 * @Description 资金管理-资金调整明细Dao层
 * @Author HuangKeXin
 * @Time 2020/04/3
 */
@Repository("businessFundManageAdjustFundDetailsDao")
public interface IBusinessFundManageAdjustFundDetailsDao extends Mapper<BusinessFundManageAdjustFundDetailsBO> {

    @Select(("SELECT COUNT(1) AS TOTAL FROM BUSINESS_FUND_MANAGE_ADJUST_FUND_DETAILS WHERE IS_DELETE='0' AND UNIT_ID=#{unitId}"))
    Integer queryExistCountByFoundManageDetailsAdjustUnitId(String unitId);
    @Update("UPDATE BUSINESS_FUND_MANAGE_ADJUST_FUND_DETAILS SET IS_DELETE='1' WHERE IS_DELETE='0' AND UNIT_ID = #{unitId}")
    void deleteFundManageAdjustByUnitId(String unitId);
}
